import {UserType} from "../models/user";
//主要目的是：定义一个变量用于缓存当前登录的用户
let currentUserState : UserType;


const setCurrentUserState = (user:UserType) =>{
    console.log("user")
    console.log(user)
    currentUserState = user;
    console.log("set")
    console.log(currentUserState)
}

const getCurrentUserState = ():UserType =>{
    console.log("get");
    console.log(currentUserState);
    return currentUserState;
}

// @ts-ignore
export {
    getCurrentUserState,
    setCurrentUserState,
}

